<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        *{
            padding: 0;
            margin: 0;

        }
        body{
            background:#ddd;
        }
        #canvas{
            margin:10px;
            background:#fff;
            border:thin inset #aaa;
        }
    </style>
    <script>
        onload=function(){

            var canvas=document.getElementById('canvas');
            var context=canvas.getContext('2d');//d必须小写
            context.lineJoin="round";
            context.lineWidth=20;
            context.fillRect(50,50,100,100)
            context.strokeRect(50,200,100,100)


        }
    </script>
</head>
<body>
<canvas id='canvas' width='750' height='500'>
    Canvas not supported!
</canvas>
</body>
</html>